package com.cat.recruit.bean.dto;

import com.cat.recruit.entity.Access;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 用于存放访问记录的DTO
 */
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "预约时间段")
@Data
public class AccessDTO {
    /**
     * 考核id，主键id
     */
    private Integer accessId;

    /**
     * 学生dto
     */
    private UserDTO studentDTO;

    /**
     * 考核类型编码（如1：一面，2：一轮考核）
     */
    private String accessType;

    /**
     * 考核方向
     */
    private String direction;

    /**
     * 预约id
     */
    private Integer appointmentSlotId;

    /**
     * 状态（0：未开始，1：已开始）
     */
    private Integer state;

    /**
     * 评分评论列表
     */
    private List<ScoreCommentDTO> scoreCommentList;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    public AccessDTO(Access access, UserDTO studentDTO,List<ScoreCommentDTO> scoreCommentList) {
        this.accessId = access.getAccessId();
        this.studentDTO = studentDTO;
        this.accessType = access.getAccessType();
        this.direction = access.getDirection();
        this.appointmentSlotId = access.getAppointmentSlotId();
        this.state = access.getState();
        this.scoreCommentList = scoreCommentList;
        this.createTime = access.getCreateTime();
        this.updateTime = access.getUpdataTime();
    }
}
